package 每日一题;

public class Three的幂 {

    public boolean isPowerOfThree(int n) {
        if (n==0)
            return false;
        while (n!=1){
            int i = n % 3;
            if (i!=0)
                return false;
            n/=3;
        }
        return true;
    }
}
